﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace DataInit.Migrations
{
    public partial class test1 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "ActionEntity",
                columns: table => new
                {
                    ID = table.Column<long>(nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    RequestID = table.Column<Guid>(nullable: false),
                    Version = table.Column<long>(nullable: false),
                    CreationDT = table.Column<DateTime>(nullable: false),
                    CreationBy = table.Column<long>(nullable: true),
                    UpdateDT = table.Column<DateTime>(nullable: false),
                    UpdateBy = table.Column<long>(nullable: true),
                    LastUpdate = table.Column<DateTime>(nullable: false),
                    DataState = table.Column<int>(nullable: false),
                    IncidentNumber = table.Column<string>(nullable: true),
                    ActionType = table.Column<int>(nullable: false),
                    AssignTo = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_ActionEntity", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "Ambulance",
                columns: table => new
                {
                    ID = table.Column<long>(nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    RequestID = table.Column<Guid>(nullable: false),
                    Version = table.Column<long>(nullable: false),
                    CreationDT = table.Column<DateTime>(nullable: false),
                    CreationBy = table.Column<long>(nullable: true),
                    UpdateDT = table.Column<DateTime>(nullable: false),
                    UpdateBy = table.Column<long>(nullable: true),
                    LastUpdate = table.Column<DateTime>(nullable: false),
                    DataState = table.Column<int>(nullable: false),
                    IncidentNumber = table.Column<string>(nullable: true),
                    ResourceKey = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Ambulance", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "Appliance",
                columns: table => new
                {
                    ID = table.Column<long>(nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    RequestID = table.Column<Guid>(nullable: false),
                    Version = table.Column<long>(nullable: false),
                    CreationDT = table.Column<DateTime>(nullable: false),
                    CreationBy = table.Column<long>(nullable: true),
                    UpdateDT = table.Column<DateTime>(nullable: false),
                    UpdateBy = table.Column<long>(nullable: true),
                    LastUpdate = table.Column<DateTime>(nullable: false),
                    DataState = table.Column<int>(nullable: false),
                    IncidentNumber = table.Column<Guid>(nullable: false),
                    ResourceKey = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Appliance", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "IncCurrentRes",
                columns: table => new
                {
                    ID = table.Column<long>(nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    RequestID = table.Column<Guid>(nullable: false),
                    Version = table.Column<long>(nullable: false),
                    CreationDT = table.Column<DateTime>(nullable: false),
                    CreationBy = table.Column<long>(nullable: true),
                    UpdateDT = table.Column<DateTime>(nullable: false),
                    UpdateBy = table.Column<long>(nullable: true),
                    LastUpdate = table.Column<DateTime>(nullable: false),
                    DataState = table.Column<int>(nullable: false),
                    IncidentNumber = table.Column<string>(nullable: true),
                    ResourceKey = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_IncCurrentRes", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "Incident",
                columns: table => new
                {
                    ID = table.Column<long>(nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    RequestID = table.Column<Guid>(nullable: false),
                    Version = table.Column<long>(nullable: false),
                    CreationDT = table.Column<DateTime>(nullable: false),
                    CreationBy = table.Column<long>(nullable: true),
                    UpdateDT = table.Column<DateTime>(nullable: false),
                    UpdateBy = table.Column<long>(nullable: true),
                    LastUpdate = table.Column<DateTime>(nullable: false),
                    DataState = table.Column<int>(nullable: false),
                    IncidentNumber = table.Column<Guid>(nullable: false),
                    GroupId = table.Column<string>(nullable: true),
                    OperatorId = table.Column<Guid>(nullable: false),
                    Status = table.Column<int>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Incident", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "IncidentAddress",
                columns: table => new
                {
                    ID = table.Column<long>(nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    RequestID = table.Column<Guid>(nullable: false),
                    Version = table.Column<long>(nullable: false),
                    CreationDT = table.Column<DateTime>(nullable: false),
                    CreationBy = table.Column<long>(nullable: true),
                    UpdateDT = table.Column<DateTime>(nullable: false),
                    UpdateBy = table.Column<long>(nullable: true),
                    LastUpdate = table.Column<DateTime>(nullable: false),
                    DataState = table.Column<int>(nullable: false),
                    IncidentNumber = table.Column<string>(nullable: true),
                    ChineseName = table.Column<string>(nullable: true),
                    EnglishName = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_IncidentAddress", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "LoginOperator",
                columns: table => new
                {
                    ID = table.Column<long>(nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    RequestID = table.Column<Guid>(nullable: false),
                    Version = table.Column<long>(nullable: false),
                    CreationDT = table.Column<DateTime>(nullable: false),
                    CreationBy = table.Column<long>(nullable: true),
                    UpdateDT = table.Column<DateTime>(nullable: false),
                    UpdateBy = table.Column<long>(nullable: true),
                    LastUpdate = table.Column<DateTime>(nullable: false),
                    DataState = table.Column<int>(nullable: false),
                    OperatorId = table.Column<Guid>(nullable: false),
                    OperatorName = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_LoginOperator", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "ResMonitor",
                columns: table => new
                {
                    ID = table.Column<long>(nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    RequestID = table.Column<Guid>(nullable: false),
                    Version = table.Column<long>(nullable: false),
                    CreationDT = table.Column<DateTime>(nullable: false),
                    CreationBy = table.Column<long>(nullable: true),
                    UpdateDT = table.Column<DateTime>(nullable: false),
                    UpdateBy = table.Column<long>(nullable: true),
                    LastUpdate = table.Column<DateTime>(nullable: false),
                    DataState = table.Column<int>(nullable: false),
                    IncidentNumber = table.Column<Guid>(nullable: false),
                    CreationTime = table.Column<DateTime>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_ResMonitor", x => x.ID);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "ActionEntity");

            migrationBuilder.DropTable(
                name: "Ambulance");

            migrationBuilder.DropTable(
                name: "Appliance");

            migrationBuilder.DropTable(
                name: "IncCurrentRes");

            migrationBuilder.DropTable(
                name: "Incident");

            migrationBuilder.DropTable(
                name: "IncidentAddress");

            migrationBuilder.DropTable(
                name: "LoginOperator");

            migrationBuilder.DropTable(
                name: "ResMonitor");
        }
    }
}
